home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / HARDWARE / IICALARM / !iicAlarm / !Help < prev    next >
Text File  |  1994-05-22  |  9KB  |  187 lines

  1.  
  2.  -- !Help -- !iicAlarm 1.00
  3.  
  4. by Andreas Barth, May 1994
  5.  
  6. A hardware expansion to automatically switch the computer on and off.
  7.  
  8. !iicAlarm uses the alarm-functions of the standard Archimedes clock-chip
  9. PFC8583, which are currently unused.
  10. It allows setting an alarm-time and switching an alarm-line at that time.
  11. Using a small circuit, this alarmline can be used to switch the computer on.
  12. Under the Desktop, the !Alarm-Application calls the desired programs as
  13. nescessary. At the end of an automatic session, the next alarmtime is set
  14. and the computer switches off via program control.
  15.  
  16. Requires RiscOS 3.
  17.  
  18. Introduction
  19. ------------
  20. The clock-chip inside the Archimedes is a PCF8583, a clock with calendar,
  21. Alarm, Timer and RAM. The alarm can drive an open-collector-output.
  22. The chip has got 256 Bytes of address-space. That are 240 Bytes of CMOS Ram,
  23. 8 Bytes of clock informations and 8 Bytes for unused alarm-registers which
  24. may be used as Ram as long as the alarm-system is disabled.
  25. RISC OS doesn't use the 8 bytes of the alarm-system (up to now).
  26. The chip has got an output that can be set by the alarm-system and is suitable
  27. to switch something at a specific time. Using a simple flipflop-circuit with an
  28. input delay of several seconds and an output that can drive a relay or a
  29. solid-state-relay, we can switch a high-voltage load, at last our own computer.
  30. In the end, we need some software, that examines the clock-status and sets
  31. the alarm-time.
  32. To keep things simple, I use the !Alarm-application to manage time-events.
  33. Under Risc OS 3, !Alarm can handle Task-alarms, meaning that you can call a
  34. program or *Command or batchfile at a given time with a given repeat rate.
  35. It seemed sensible to use these task-alarm entries in an alarm-database to
  36. set the next alarm-time inside the clock-chip, since it is only necessary to
  37. write an alarm-database-reader that extracts the next task-alarm-time.
  38. Setup and updating of the alarms is completely up to the !Alarm-application.
  39.  
  40. Software
  41. --------
  42. During all phases of running, the computer needs some programs to control
  43. the alarm clock.
  44. Five small programs perform all the work.
  45.  
  46. So the following should happen:
  47. <The computer is switched on and wants to boot from floppy- or harddisc>
  48. - Early in the Boot-sequence, the variable <Alarmfile> is set.
  49.   e.g. *Set Alarmfile System:Alarms
  50.   It should point to the standard Alarm-file used by you in your Desktop
  51.   environment. !iicAlarm uses this file to determine the next Task-Alarm-
  52.   time which is then loaded into the clock-alarm-register.
  53.  
  54. - !iicAlarm -- is to be called during the boot-sequence, possibly before
  55.   the Desktop is started.
  56.   It determines whether the computer was automatically started or not,
  57.   and sets the variable <AlarmMode> accordingly.
  58.   (Reads the <Alarmfile> to determine the next Task-Alarm-time.
  59.    BUG: If the actual alarm-time is a repeated one, which takes place before
  60.    the next Task-alarm-record in the file, then this is ignored.)
  61.   This also installs a small module that captures your <ShiftControlF12>-key
  62.   and performs a new shutdown-sequence.
  63.  
  64. - Start !Alarm with <Alarmfile> as argument when you enter the Desktop.
  65.   !Alarm performs all actions to task-alarms and repeated alarms just as
  66.   normal.
  67.  
  68.  
  69. - !AlarmOff   -- *AlarmOff
  70.   Can always be used to switch off the alarm-system.
  71.   The clock is put to Alarm-mode with alarms disabled.
  72.  
  73. - !AlarmOn    -- *AlarmOn
  74.   Can always be used to reinitialise the alarmsystem.
  75.   Performs a call to !AlarmOff and AlarmSet which will set the user mode
  76.   and the clock to the next task-alarm-time found in the file.
  77.  
  78.  
  79. - !AlarmQuit  -- *AlarmQuit
  80.   To end your automatic batchfiles, you can call this program.
  81.   It does nothing if the user has switched on the computer,
  82.   and it simply switches the computer off if the mode indicates an
  83.   automatic run. It does not "Shutdown" the desktop !
  84.  
  85. - !AlarmShut  -- *AlarmShut, *Bye
  86.   Shutdown-Application for Desktop-use. Should replace the Taskmanagers
  87.   <Shift-Control-F12> and quits all Applications, sets the next alarm-time
  88.   and switches the computer off.
  89.  
  90. These programs can be called by CLI-commands as well. There are Aliases
  91. in the !AlarmBoot-Sequence.
  92. You can simply call '*AlarmQuit' at the end of your automatic program.
  93.  
  94. - The keyScan-module links itself into the InsV-vector and captures the
  95.   standard exit-key <scF12>. Under the Wimp, it installs a small module-task
  96.   that initiates a wimptask-command when the key is pressed.
  97.   One press will perform a "*Filer_Opendir ...Tools"
  98.   two presses will call    "*AlarmShut"
  99.   The Shutdown-command in the TaskManager-menu is unaffected and you cannot
  100.   switch off your computer with that.
  101.  
  102.  
  103. Hardware
  104. --------
  105. Note !
  106. - The circuit is for A3xx/A4xx/A3000 only, because it uses the
  107.   Auxiliary-IO-port (Alarm and Aux1/2), which is normally unused and not fitted.
  108. - A3000 don't have an AuxIOport. You have to make it yourself.
  109.   Necessary are: Alarm: IC6, pin 7  -> pin 5 of our AuxIO-connector.
  110.                  Aux 1: IC18 pin 17 -> pin 3 of our AuxIO-connector.
  111.                  Aux 2: IC18 pin 18 -> pin 2 of out AuxIO-connector.
  112. - New computers (A3010,3020,4000,5000) with the new IOEB don't have an
  113.   AuxIOport and don't have Aux1/2. No way here.
  114. - If you have a good VIDC-enhancer then this is switched by Aux1/2.
  115.   No good for our purpose. Determine which bit it uses and take the other
  116.   one for our circuit. Change the Bit in program 'SwitchOff' and '!AlarmShut'
  117.   just before the CALL is made. Bit 0 and Bit 1 are Aux1 and 2 respectively.
  118.  
  119. Function
  120. The clock-chip inside the Archimedes is a PCF8583, a clock with calendar,
  121. Alarm, Timer and RAM. The alarm can drive an open-collector-output.
  122. There are various modes for an alarm: Timeralarm, daily alarm, weekday
  123. and dated. We only use the dated alarm.
  124. By default (eg. after changing the battery) the alarmsystem is off and the
  125. alarm-line shows a one second clock signal. So our little circuit has to be
  126. safe enough to filter this out (we don't want our computer to be switched on
  127. and off every second, don't we).
  128. The circuit should consume very low energy and should be simple.
  129.  
  130. Have a look at the circuit and pcb-drawings.
  131. Its really simple. The circuit is very high impedance and needs only
  132. about 6uA in standby-mode at 3V.
  133. It's a simple FlipFlop-circuit with ALARM at the SET-input and AUX1 or 2 at
  134. the RESET-input. The first gate simply produces a known voltage/current
  135. output, feeding a RC-combination which acts as time-delay for the real
  136. flipflop. The input-signal has to be stable for about 5 seconds to actually
  137. set or reset the FF.
  138.  
  139. Connections
  140. The completed circuit has 5 connectors:
  141. 1) Auxiliary-I/O-Connector
  142.    5pins, connects to PL10 in an A3xx/4xx. Pin 1 ist marked on both sides.
  143.    The pins up from '1' are: Gnd, Aux2, Aux1, C4, Alarm.
  144. 2) and 3) Power and battery-connector
  145.   2pins each. Connect one with the battery (or a new one with 3V),
  146.   and the second with the internal +5V supply. This is easily to be found
  147.   on the floppy-disc-power-connector, where the marked cable is +5V, then
  148.   Gnd, Gnd and +12V.
  149. 4) Switch
  150.   2pins. Gives a supply secured with a 47ohm resistance.
  151.   The ground pin is switched by a BS108 VMOSFET (I just have had this one in my
  152.   toolbox, so I took it. No real reason for that). This thing can resist
  153.   200V and source max. 260mA (although our battery wouldn't do that).
  154.   I use a solid-state-relais which is driven by an LED and hence
  155.   works with 3V and 1.2mA. (But these cannot drive inductive loads)
  156. 5) On/Off-switch
  157.   The circuit version 1.00 has got a second input in parallet to the alarm
  158.   input. It takes about 5 seconds to switch the computer on with that input.
  159.   I made a change in the circuit-plan to allow a switch to set and reset the
  160.   flip-flop. You can install a presskey on the front of your Archimedes to
  161.   switch the system on and off more comfortable.
  162.   This switch DOESN'T WORK if the alarm line is active and as long as the
  163.   alarm line is active, because this sets the flipflop all the time, disabling
  164.   the reset-input.
  165.   So you need at least a piece of software that switches the alarm-line off.
  166.   Every !iicAlarm-tool can do that, but without it you only can unplug the
  167.   cable. - The next circuit will be better.
  168.  
  169. The end
  170. -------
  171. !iicAlarm is copyright by me and may be used and copied for non-profit use,
  172. and as long as every part is included in the copy without changes.
  173. I take no liabilities for whatsoever.
  174. If you like to give me some comments, write to:
  175.  Andreas Barth
  176.   Karl-Eberhardstr. 9
  177.   W-51643 Gummersbach
  178.     Germany
  179.   Tel. 0049 2261/27042
  180.   EMail: Andreas_Barth@ruba.rz.ruhr-uni-bochum.de (valid till Sept. 1994)
  181.  
  182. ToDo
  183. -----
  184. Well, it works, eh ?
  185. - Pack everything in a small module.
  186. - build a better circuit.
  187.